package exercise;

public class MessageBox extends Product {
    private char decochar;

    public MessageBox(char decochar){
        this.decochar = decochar;
    }

    void use(String s) {
        System.out.println(getLine(s));
        System.out.println(decochar + " " + s + " " +decochar);
        System.out.println(getLine(s));
    }

    private String getLine(String s){
        StringBuilder result = new StringBuilder();

        for(int i = 0; i < s.length(); i++){
            result.append(decochar);
        }

        return result.toString();
    }
}
